{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## week02练习题"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 课后作业(1)：利用今天的学的datatime模块与if语句做一个课程提醒工具"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "课程提醒工具\n",
      "2\n",
      "今天周二哦\n",
      "3-5 新媒体分析和用户体验\n",
      "12-13 数码插画技法\n",
      "over\n"
     ]
    }
   ],
   "source": [
    "print(\"课程提醒工具\")\n",
    "import datetime\n",
    "time = datetime.datetime.today().weekday()\n",
    "week_time = int(time)\n",
    "print (week_time)\n",
    "if week_time==1:\n",
    "    print(\"今天周一哦\");print(\"6-7 形势与政策\");print(\"12-13 广告文案写作\")\n",
    "elif week_time==2:\n",
    "      print(\"今天周二哦\");print(\"3-5 新媒体分析和用户体验\");print(\"12-13 数码插画技法\")\n",
    "elif week_time==3:\n",
    "      print(\"今天周三哦\");print(\"1-2 APP设计与原型制作\");print(\"3-5 平台经济与创新\")\n",
    "elif week_time==4:\n",
    "      print(\"今天周四哦\");print(\"1-2 数码照片的处理与创意设计\");print(\"8-10 文艺美学\");print(\"12-13 流行文化\");print(\"14-15 就业指导\")   \n",
    "elif week_time==3:\n",
    "      print(\"今天周五哦\");print(\"3-5 python语言\")\n",
    "else:\n",
    "    print(\"放假啦！！！\")\n",
    "print(\"over\")\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 课后作业(2)：利用random 模块与if 语句做一个“猜猜的小游戏”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入名字小美女\n",
      "考研必定辉煌！\n",
      "那变更漂亮吧！\n"
     ]
    }
   ],
   "source": [
    "a=input(\"请输入名字\")\n",
    "import random\n",
    "i = random.randint(1,7)\n",
    "if i ==1:\n",
    "    print(\"考研一定成功！\")\n",
    "if i ==2:\n",
    "    print(\"考研终将胜利！\")\n",
    "if i ==3:\n",
    "    print(\"考研必定辉煌！\")\n",
    "if i ==4:\n",
    "    print(\"考六级一定过！\")\n",
    "if i ==5:\n",
    "    print(\"今年拿到奖学金！\")\n",
    "if i ==6:\n",
    "    print(\"平平安安健健康康\")\n",
    "else:\n",
    "    print(\"那变更漂亮吧！\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 课后作业(3)：利用for循环与range内置函数打印一个“9*9的乘法口诀”"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1*1=1\t\n",
      "2*1=2\t2*2=4\t\n",
      "3*1=3\t3*2=6\t3*3=9\t\n",
      "4*1=4\t4*2=8\t4*3=12\t4*4=16\t\n",
      "5*1=5\t5*2=10\t5*3=15\t5*4=20\t5*5=25\t\n",
      "6*1=6\t6*2=12\t6*3=18\t6*4=24\t6*5=30\t6*6=36\t\n",
      "7*1=7\t7*2=14\t7*3=21\t7*4=28\t7*5=35\t7*6=42\t7*7=49\t\n",
      "8*1=8\t8*2=16\t8*3=24\t8*4=32\t8*5=40\t8*6=48\t8*7=56\t8*8=64\t\n",
      "9*1=9\t9*2=18\t9*3=27\t9*4=36\t9*5=45\t9*6=54\t9*7=63\t9*8=72\t9*9=81\t\n"
     ]
    }
   ],
   "source": [
    "for a in range(1,10):\n",
    "    for i in range(1,1+a):\n",
    "        sum=a*i\n",
    "        print(str(a)+\"*\"+str(i)+\"=\"+str(sum),end=\"\\t\")\n",
    "    print()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
